#!/bin/bash

# "$0"可能是个软连接
PRG="$0"

while [ -h "$PRG" ] ; do
  ls=`ls -ld "$PRG"`
  link=`expr "$ls" : '.*-> \(.*\)$'`
  if expr "$link" : '/.*' > /dev/null; then
    PRG="$link"
  else
    PRG=`dirname "$PRG"`/"$link"
  fi
done

# 获取执行命令的绝对路径
PRGDIR=`dirname "$PRG"`
# 执行命令
EXECUTABLE=launch.sh

# export DEBUG=true

"$PRGDIR"/"$EXECUTABLE" restart "$@"
